/*
 * Copyright 2023-present by Damon All Rights Reserved
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package router

import (
	"github.com/cloudwego/hertz/pkg/app/server"
	hello2 "primus/consumer-service/handler/hello"
	"primus/pkg/mw"
)

/*
* @author Damon
* @date   2023/5/5 11:55
 */

func Init(r *server.Hertz)  {
	v := r.Group("/v1") //, license.LicenceIssued() ...)
	//curl -X POST "http://localhost:10000/v1/login"
	v.POST("/login", )

	v1 := r.Group("/api/v1") //, license.LicenceIssued()...)

	v1.Use(mw.AuthMiddleWare())
	{
		hello := v1.Group("/hello")
		hello.GET("", hello2.GetH2)

	}

	//hello := v1.Group("/hello")
	//hello.Use()//middle func
	//{
	//	//curl -i -H "Accept: application/json" -H "Authorization:bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODI2ODc0NzQsIm9yaWdfaWF0IjoxNjgyNjgzODc0fQ.GO5JL1poD-jwKpJaBCtSHutxQEw_2UpfrNCF_b39aA0" -X GET 'http://localhost:10000/api/v1/hello'
	//	hello.GET("", handler.GetH2)
	//}
}
